<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @copyright   Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php /** @var  $this \Magento\Sales\Block\Order\View*/?>
<div class="order-details-items ordered">
    <?php $_order = $this->getOrder() ?>

    <div class="order-title">
        <strong><?php echo __('Items Ordered') ?></strong>
        <?php if ($_order->getTracksCollection()->count()) : ?>
            <?php echo $this->getChildHtml('tracking-info-link') ?>
        <?php endif; ?>
    </div>

    <?php echo $this->getChildHtml('order_items') ?>

    <?php if($this->helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('order', $_order) && $_order->getGiftMessageId()): ?>
    <div class="block block-order-details-additional">
        <div class="block-title"><strong><?php echo __('Gift Message for This Order') ?></strong></div>
        <?php $_giftMessage=$this->helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($_order); ?>
        <div class="block-content">
            <dl class="gift-message">
                <dt class="gift-sender"><strong class="label"><?php echo __('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
                <dt class="gift-recipient"><strong class="label"><?php echo __('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
                <dd class="gift-message-text"><?php echo $this->helper('Magento\GiftMessage\Helper\Message')->getEscapedGiftMessage($_order) ?></dd>
            </dl>
        </div>
    </div>
    <?php endif; ?>

    <div class="actions-toolbar">
        <div class="secondary">
            <a class="action back" href="<?php echo $this->getBackUrl() ?>">
                <span><?php echo $this->getBackTitle() ?></span>
            </a>
        </div>
    </div>
</div>
